package chapter5_polymorphic_PracticeOnTheMachine;

public class Plane extends Common{
	private float Plane1;
	private float Plane2;
	private float Plane3;
	private float Length;

	public Plane(float p1, float p2, float p3) {
		this.Plane1 = p1;
		this.Plane2 = p2;
		this.Plane3 = p3;
	}
	
	public Plane(float p1, float p2, float p3,float length) {
		this.Plane1 = p1;
		this.Plane2 = p2;
		this.Plane3 = p3;
		this.Length = length;
	}
	
	public float time() {
		float time = Length * 1000 / (this.Plane1 + this.Plane2 + this.Plane3);
		return time;
		
	}
	
	public float speed() {
		float velocity = this.Plane1 + this.Plane2 + this.Plane3;
		return velocity;
	}
}
